const express = require('express')
const CourseRouter = express.Router()
const CourseController = require('../controllers/CourseController.js')

CourseRouter.post('/api/course/add', CourseController.add)
CourseRouter.get('/api/course/list', CourseController.getList)
CourseRouter.get('/api/course/listpublished', CourseController.getListPublished)
CourseRouter.get('/api/course/list/:id', CourseController.getList)
CourseRouter.get('/api/course/mylist/:username', CourseController.getMyList)
CourseRouter.get('/api/course/mylistpublished/:username', CourseController.getMyListPublished)
CourseRouter.get('/api/course/studentlist/:major', CourseController.getStudentList)
CourseRouter.get('/api/course/studentpublishedlist/:major', CourseController.getStudentPublishedList)
CourseRouter.put('/api/course/list/:id', CourseController.putList)
CourseRouter.delete('/api/course/list/:courseid', CourseController.delList)
CourseRouter.put('/api/course/ispublish/:courseid', CourseController.putPublish)
CourseRouter.get('/api/course/total', CourseController.getTotal)
CourseRouter.get('/api/course/mytotal/:username', CourseController.getMyTotal)

module.exports = CourseRouter
